<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Slides - Prevent Default</title>
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
    />
    <link href="../../../../../css/core.css" rel="stylesheet" />
    <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
    <script nomodule src="../../../../../dist/ionic/ionic.js"></script>
    <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
    <style>
      .blueBackground {
        --background: blue;
      }
    </style>
  </head>

  <body>
    <ion-app>
      <ion-content id="contentWithBackground">
        <ion-slides style="height: 200px">
          <ion-slide>
            <ion-content id="contentWithScrolling">
              <div>
                <ion-button id="scrollDownButton" onclick="scrollDown(event)">Scroll down</ion-button>
              </div>
              <div>
                <ion-button id="changeBackgroundButton" onclick="changeBackground(event)" style="margin-top: 200px"
                  >Change Background</ion-button
                >
              </div>
            </ion-content>
          </ion-slide>
        </ion-slides>
      </ion-content>
    </ion-app>
    <script>
      const contentWithBackground = document.getElementById('contentWithBackground');
      const changeBackgroundButton = document.getElementById('changeBackgroundButton');

      function scrollDown(event) {
        changeBackgroundButton.scrollIntoView();
      }

      function changeBackground(event) {
        contentWithBackground.classList.add('blueBackground');
      }
    </script>
  </body>
</html>
